<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\validate;

/**
 * 简历验证器
 */
class resume extends AdminBase
{

    // 验证规则
    protected $rule =   [
      'nickname'              => 'require',
      'mobile'                => 'require|unique:resume|number',
      'email'                 => 'require|email|unique:resume',
      'idnumbei'              => 'require|unique:resume|number',
      'age'                   => 'require|number',
      'sex'                   => 'require',
      'shool'                 => 'require',
      'major'                 => 'require',
      'education'             => 'require',
      'experience'            => 'require',
    ];

    // 验证提示
    protected $message  =   [

      'nickname.require'              => '昵称不能为空',
      'email.require'                 => '邮箱不能为空',
      'mobile.number'                 => '手机号必须为数字',
      'mobile.require'                => '手机号不能为空',
      'idnumbei.require'              => '身份证号不能为空',
      'sex.require'                   => '性别不能为空',
      'age.require'                   => '年龄不能为空',
      'age.number'                    => '年龄必须为数字',
      'school.require'                => '毕业学校不能为空',
      'major.require'                 => '专业不能为空',
      'education.require'             => '学历不能为空',
      'experience.require'            => '实习经历不能为空',

    ];

    // 应用场景
    protected $scene = [

        'edit' =>  ['email','mobile','nickname','idnumbei','age','sex'],
        'add'  =>  ['email','mobile','nickname','idnumbei','age','sex'],
    ];

}
